package com.ymttest.database.sqlwapper.godmch;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.MarkupConfig;
import com.ymttest.database.model.MarkupConfigKey;
import com.ymttest.database.model.mch_info;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/************************************************************************************
 * @Author : 杨宇通
 * @Date : 2020-04-08
 * @Copyright : 洋码头
 *godmach
 ************************************************************************************/
public class MarkupconfigWapper {
	SqlManager manage;
	public MarkupconfigWapper() {
		manage = new SqlManager("mysqlgodmchdb" + EnvSetup.getEnv());
		 
	}
	public List<MarkupConfig> selectbyPrimaryKey(int agentUserId,int rootUserId) throws InterruptedException {
		MarkupConfigKey key=new MarkupConfigKey();
		key.setAgentId(agentUserId);
		key.setSupplierId(rootUserId);
		List<MarkupConfig> list=manage.getSelectResults("com.ymttest.database.mapping.godmch.MarkupConfigMapper.selectByPrimaryKey", key);
		manage.commit();
		return list;
	}
	
	
	
	public List<MarkupConfig> selectBySupplierId(int supplierId) throws InterruptedException {

		List<MarkupConfig> list=manage.getSelectResults("com.ymttest.database.mapping.godmch.MarkupConfigMapper.selectBySupplierId", supplierId);
		manage.commit();
		return list;
	}
	
	public List<MarkupConfig>  selectByCreatTime (String creatTime)
	{
		List<MarkupConfig> list=manage.getSelectResults("com.ymttest.database.mapping.godmch.MarkupConfigMapper.selectByCreatTime", creatTime);
		manage.commit();
		return list;
	}
	public static void main(String args[]) throws InterruptedException {
		//List<MarkupConfig> selectbyPrimaryKey = new MarkupconfigWapper().selectbyPrimaryKey(500772154, 500772152);
		
		List<MarkupConfig> selectbyPrimaryKey = new MarkupconfigWapper().selectByCreatTime(null);
		
		System.out.println(selectbyPrimaryKey);
	}
}
